using System;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace Triton.Common
{
	public class Hotkey : IEquatable<Hotkey>
	{
		[CompilerGenerated]
		private Action<Hotkey> action_0;

		[CompilerGenerated]
		private int int_0;

		[CompilerGenerated]
		private Keys keys_0;

		[CompilerGenerated]
		private ModifierKeys modifierKeys_0;

		[CompilerGenerated]
		private string string_0;

		[CompilerGenerated]
		private bool bool_0;

		public Action<Hotkey> Callback
		{
			[CompilerGenerated]
			get
			{
				return action_0;
			}
			[CompilerGenerated]
			set
			{
				action_0 = value;
			}
		}

		public int Id
		{
			[CompilerGenerated]
			get
			{
				return int_0;
			}
			[CompilerGenerated]
			private set
			{
				int_0 = value;
			}
		}

		public Keys Key
		{
			[CompilerGenerated]
			get
			{
				return keys_0;
			}
			[CompilerGenerated]
			private set
			{
				keys_0 = value;
			}
		}

		public ModifierKeys ModifierKeys
		{
			[CompilerGenerated]
			get
			{
				return modifierKeys_0;
			}
			[CompilerGenerated]
			private set
			{
				modifierKeys_0 = value;
			}
		}

		public string Name
		{
			[CompilerGenerated]
			get
			{
				return string_0;
			}
			[CompilerGenerated]
			private set
			{
				string_0 = value;
			}
		}

		internal bool Boolean_0
		{
			[CompilerGenerated]
			get
			{
				return bool_0;
			}
			[CompilerGenerated]
			set
			{
				bool_0 = value;
			}
		}

		internal Hotkey(string name, Keys key, ModifierKeys modifierKeys, int id, Action<Hotkey> callback)
		{
			Name = name;
			Key = key;
			ModifierKeys = modifierKeys;
			Id = id;
			Callback = callback;
		}

		public bool Equals(Hotkey other)
		{
			if ((object)other == null)
			{
				return false;
			}
			if ((object)this == other)
			{
				return true;
			}
			if (Id == other.Id)
			{
				return string.Equals(Name, other.Name);
			}
			return false;
		}

		public override string ToString()
		{
			return Name + " [" + method_0() + "]";
		}

		private string method_0()
		{
			string text = "";
			if (ModifierKeys.HasFlag(ModifierKeys.Control))
			{
				text += "Ctrl + ";
			}
			if (ModifierKeys.HasFlag(ModifierKeys.Alt))
			{
				text += "Alt + ";
			}
			if (ModifierKeys.HasFlag(ModifierKeys.Shift))
			{
				text += "Shift + ";
			}
			return text + Key;
		}

		public override bool Equals(object obj)
		{
			if (obj == null)
			{
				return false;
			}
			if (this == obj)
			{
				return true;
			}
			if (obj.GetType() != GetType())
			{
				return false;
			}
			return Equals((Hotkey)obj);
		}

		public override int GetHashCode()
		{
			return (Id * 397) ^ ((Name != null) ? Name.GetHashCode() : 0);
		}

		public static bool operator ==(Hotkey left, Hotkey right)
		{
			return object.Equals(left, right);
		}

		public static bool operator !=(Hotkey left, Hotkey right)
		{
			return !object.Equals(left, right);
		}
	}
}
